import CryptoJS from 'crypto-js'
const key = 'egoonet3466==#.1'

// 加密
export function aesSign(pass) {
  let encrypt = CryptoJS.AES.encrypt(pass, CryptoJS.enc.Utf8.parse(key), {
    mode: CryptoJS.mode.ECB,
    padding: CryptoJS.pad.Pkcs7
  }).toString()
  return encrypt
}

// 解密
export function unaesSign(pass) {
  let decrypt = CryptoJS.AES.decrypt(pass, CryptoJS.enc.Utf8.parse(key), {
    mode: CryptoJS.mode.ECB,
    padding: CryptoJS.pad.Pkcs7
  }).toString(CryptoJS.enc.Utf8)
  return decrypt
}
